<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="s_product" :rules="rules" label-width="100px" id="mvcfm"> 盘存类型 <el-select v-model="empty">
        <el-option label="全部" value="全部" />
        <el-option label="已盘存" value="已盘存" />
        <el-option label="未盘存" value="未盘存" />
        <el-option label="盘存差异" value="盘存差异" />
      </el-select>
      <div>
      </div>
      <el-button @click="gotoPage('/psi/supplychainmana/InventoryDifBat?'+vueparams+'')" type='primary' size="mini">开始盘存</el-button>
      <el-button @click="gotoPage('/psi/supplychainmana/InventoryTask?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 盘存产品 </span>
      </div>
      <el-table :data="s_product">
        <el-table-column label="产品条形码" prop="product_barcode">
          <template slot-scope="scope">
            <el-link @click="popInventoryLibProDet('')" type='primary'>{{scope.row['']}}</el-link>
          </template>
        </el-table-column>
        <el-table-column label="产品名称" prop="product_name">
        </el-table-column>
        <el-table-column label="规格型号" prop="product_model">
        </el-table-column>
        <el-table-column label="产品位置" prop="product_norm">
        </el-table-column>
        <el-table-column label="累积数量" prop="product_num">
        </el-table-column>
        <el-table-column label="实际盘存数" prop="take_num">
        </el-table-column>
        <el-table-column label="盘存结论" prop="take_verdict">
        </el-table-column>
        <el-table-column label="状态" prop="">
        </el-table-column>
      </el-table>
    </el-form>
    <el-dialog :visible.sync="InventoryLibProDetVisible" append-to-body>
      <InventoryLibProDet v-if="InventoryLibProDetVisible" ref="InventoryLibProDet" :popparams="popparams"> </InventoryLibProDet>
    </el-dialog>
  </div>
</template>
<script>
  import request from '@/utils/request'
  import InventoryLibProDet from "@/views/psi/supplychainmana/InventoryLibProDet";
  export default {
    name: 'InventoryPro',
    components: {
      InventoryLibProDet,
    },
    props: ['popparams'],
    data() {
      return {
        InventoryLibProDetVisible: false,
        InventoryLibProDetValue: null,
        InventoryLibProDetDesc: null,
        vueparams: this.getVUEParams(""),
        s_product: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/main/InventoryAction/inventoryPro?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      inventoryProSubmit(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/psi/main/InventoryAction/inventoryProSubmit?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.gotoPage("/psi/supplychainmana/InventoryDifBat/inventoryDifBat?" + this.vueparams, data);
          this.msgSuccess(data.msg);
        })
      },
      popInventoryLibProDet(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.InventoryLibProDetVisible = !this.InventoryLibProDetVisible;
      },
    },
  }
</script>
